package com.dada.dongpeng;

import org.apache.spark.SparkConf;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.SparkSession;

/**
 * Hello world!
 *
 */
public class ReadDemo {
	public static void main(String[] args) {
		SparkConf conf = new SparkConf();
		conf.set("spark.sql.catalog.paimon", "org.apache.paimon.spark.SparkCatalog");
		conf.set("spark.sql.extensions", "org.apache.paimon.spark.extensions.PaimonSparkSessionExtensions");
		conf.set("spark.sql.catalog.paimon.warehouse", "file:///opt/soft/paimon");
		SparkSession spark = SparkSession.builder().config(conf).master("local").appName("test").getOrCreate();
		Dataset<Row> dataset = spark.read().format("paimon").load("file:///opt/soft/paimon/default.db/test");

		dataset.show();
	}
}
